package com.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydd.dto.AdvimgDTO;
import com.ydd.dto.AdvimgPageQueryDTO;
import com.ydd.entity.YddAdvimg;
import com.ydd.vo.AdvimgVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description TODO
 * @Author fang
 * @Date 2023-05-29 16:09
 */
@Mapper
public interface YddAdvimgMapper extends BaseMapper<YddAdvimg> {
    /**
     * AdminIndexService-baseInfo
     * @return
     */
    @Select("select count(*) from ydd_advimg")
    Integer getAdvimgNum();

    /**
     * UserIndexService-index
     * @param bannerType
     * @return
     */
    List<AdvimgVO> getBanner(String bannerType);

    /**
     * 获取广告位下的广告图总数
     * @param id
     * @return
     */
    @Select("select count(advimgpos) from youdianda.ydd_advimg where advimgpos=#{id}")
    Integer count(Long id);

    /**
     * 广告图分页查询
     * @param advimgPageQueryDTO
     * @return
     */
    List<AdvimgVO> page(AdvimgPageQueryDTO advimgPageQueryDTO);

}
